<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('修改【请填写功能名称】')" />
    <th:block th:include="include :: datetimepicker-css" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-fuelconsumptioninfo-edit" th:object="${veFuelconsumptioninfo}">
            <input name="consumptionID" th:field="*{consumptionID}" type="hidden">
            <div class="form-group">
                <label class="col-sm-3 control-label">车辆名：</label>
                <div class="col-sm-8">
                    <select name="tripID" th:with="type=${@veVehiclesServiceImpl.getVeVehiclesList()}">
                        <option th:each="dict : ${type}" th:text="${dict.vehicleName}" th:value="${dict.vehicleID}" th:field="*{tripID}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">加油的日期：</label>
                <div class="col-sm-8">
                    <div class="input-group date">
                        <input name="consumptionDate" th:value="${#dates.format(veFuelconsumptioninfo.consumptionDate, 'yyyy-MM-dd')}" class="form-control" placeholder="yyyy-MM-dd" type="text">
                        <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                    </div>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">加油量：</label>
                <div class="col-sm-8">
                    <input name="litersAdded" th:field="*{litersAdded}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">油价格：</label>
                <div class="col-sm-8">
                    <input name="costPerLiter" th:field="*{costPerLiter}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">总油费：</label>
                <div class="col-sm-8">
                    <input name="totalCost" th:field="*{totalCost}" class="form-control" type="text">
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <th:block th:include="include :: datetimepicker-js" />
    <script th:inline="javascript">
        var prefix = ctx + "system/fuelconsumptioninfo";
        $("#form-fuelconsumptioninfo-edit").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/edit", $('#form-fuelconsumptioninfo-edit').serialize());
            }
        }

        $("input[name='consumptionDate']").datetimepicker({
            format: "yyyy-mm-dd",
            minView: "month",
            autoclose: true
        });
    </script>
</body>
</html>